/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package football;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author ACER
 */
@Entity
@Table(name = "KUNDE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Kunde.findAll", query = "SELECT k FROM Kunde k"),
    @NamedQuery(name = "Kunde.findByIdKunde", query = "SELECT k FROM Kunde k WHERE k.idKunde = :idKunde"),
    @NamedQuery(name = "Kunde.findByKdFirstName", query = "SELECT k FROM Kunde k WHERE k.kdFirstName = :kdFirstName"),
    @NamedQuery(name = "Kunde.findByKdLatName", query = "SELECT k FROM Kunde k WHERE k.kdLatName = :kdLatName"),
    @NamedQuery(name = "Kunde.findByGeburtsdatum", query = "SELECT k FROM Kunde k WHERE k.geburtsdatum = :geburtsdatum"),
    @NamedQuery(name = "Kunde.findByAdresse", query = "SELECT k FROM Kunde k WHERE k.adresse = :adresse"),
    @NamedQuery(name = "Kunde.findByPlz", query = "SELECT k FROM Kunde k WHERE k.plz = :plz"),
    @NamedQuery(name = "Kunde.findByOrt", query = "SELECT k FROM Kunde k WHERE k.ort = :ort"),
    @NamedQuery(name = "Kunde.findByIsmember", query = "SELECT k FROM Kunde k WHERE k.ismember = :ismember"),
    @NamedQuery(name = "Kunde.findByErmaessigt", query = "SELECT k FROM Kunde k WHERE k.ermaessigt = :ermaessigt")})
public class Kunde implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_KUNDE")
    private Integer idKunde;
    @Size(max = 100)
    @Column(name = "KD_FIRST_NAME")
    private String kdFirstName;
    @Size(max = 100)
    @Column(name = "KD_LAT_NAME")
    private String kdLatName;
    @Column(name = "GEBURTSDATUM")
    @Temporal(TemporalType.DATE)
    private Date geburtsdatum;
    @Size(max = 200)
    @Column(name = "ADRESSE")
    private String adresse;
    @Column(name = "PLZ")
    private Integer plz;
    @Size(max = 100)
    @Column(name = "ORT")
    private String ort;
    @Size(max = 100)
    @Column(name = "ISMEMBER")
    private String ismember;
    @Size(max = 100)
    @Column(name = "ERMAESSIGT")
    private String ermaessigt;
    @OneToMany(mappedBy = "idKunde")
    private Collection<Ticket> ticketCollection;

    public Kunde() {
    }

    public Kunde(Integer idKunde) {
        this.idKunde = idKunde;
    }

    public Integer getIdKunde() {
        return idKunde;
    }

    public void setIdKunde(Integer idKunde) {
        this.idKunde = idKunde;
    }

    public String getKdFirstName() {
        return kdFirstName;
    }

    public void setKdFirstName(String kdFirstName) {
        this.kdFirstName = kdFirstName;
    }

    public String getKdLatName() {
        return kdLatName;
    }

    public void setKdLatName(String kdLatName) {
        this.kdLatName = kdLatName;
    }

    public Date getGeburtsdatum() {
        return geburtsdatum;
    }

    public void setGeburtsdatum(Date geburtsdatum) {
        this.geburtsdatum = geburtsdatum;
    }

    public String getAdresse() {
        return adresse;
    }

    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }

    public Integer getPlz() {
        return plz;
    }

    public void setPlz(Integer plz) {
        this.plz = plz;
    }

    public String getOrt() {
        return ort;
    }

    public void setOrt(String ort) {
        this.ort = ort;
    }

    public String getIsmember() {
        return ismember;
    }

    public void setIsmember(String ismember) {
        this.ismember = ismember;
    }

    public String getErmaessigt() {
        return ermaessigt;
    }

    public void setErmaessigt(String ermaessigt) {
        this.ermaessigt = ermaessigt;
    }

    @XmlTransient
    public Collection<Ticket> getTicketCollection() {
        return ticketCollection;
    }

    public void setTicketCollection(Collection<Ticket> ticketCollection) {
        this.ticketCollection = ticketCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idKunde != null ? idKunde.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Kunde)) {
            return false;
        }
        Kunde other = (Kunde) object;
        if ((this.idKunde == null && other.idKunde != null) || (this.idKunde != null && !this.idKunde.equals(other.idKunde))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "football.Kunde[ idKunde=" + idKunde + " ]";
    }
    
}
